<!DOCTYPE html>
<html>
<head>
   <link href="build/classic/theme-gray/resources/theme-gray-all.css" rel="stylesheet" />
   <script type="text/javascript" src="build/ext-all.js"></script>
   <script type="text/javascript">

       Ext.onReady(function () {
         var btn=Ext.create('Ext.Button',{
          renderTo:Ext.getElementById("john")
          ,text:'test',
          listeners:{//此方法较为笨重，但可以一次性追回更多的事件
            click:function(){
              alert("hello!!!");
            }
          }
         });
         //附加更多的
         btn.on('click',function(){
          alert("hello john!!!");
         })
      });
   </script>
</head>
<body>
   <div id="john"></div>
</body>
</html>